package com.yanqu.road.entity.activity.chefduel;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.activity.chefduel.process2.ChefDuel2Dish;

import java.util.Map;

/**
 * 小当家个人数据
 */
public class ChefDuelData extends DataObject {

    /**
     * 活动id
     */
    private int activityId;

    private long userId;

    //1阶段1,2阶段2,3阶段3
    private int no;

    //是否有进入该阶段的资格
    private boolean able;

    //获得积分，这里可以消耗积分去商城买东西(定期入背包)
    private long integral;

    //总积分
    private long allIntegral;

    //总积分
    private int hp;

    private long hpTime;

    //当前合成后会变成什么菜品
    private int finishFoodId;

    //合成食材的信息，最终等级的商品的个数
    private String finishFoodData;

    //累计合成食材多少个了
    private int finishFoodCount;

    //桌子上现在存的食材信息
    private String tableFoodData;

    //烹饪的菜肴的id
    private int dishId;

    //当前烹饪到第几部，四下一个菜
    private int process;

    //烹饪的菜肴的总个数
    private int dishCount;

    //阶段1是否膜拜
    private boolean isWorship;

    //二阶段触发buf次数
    private int buffNum;

    //二阶段阵营
    private int campId;
    //积分变更时间
    private long rankTime;

    //阵营奖励是否领取
    private int campRewardGet;

    //上一阶段排名
    private int preRank;
    //支持的阵营
    private int supportCampId;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public boolean isAble() {
        return able;
    }

    public void setAble(boolean able) {
        if(able != this.able){
            this.able = able;
            setUpdateOption();
        }
    }

    public long getIntegral() {
        return integral;
    }

    public void setIntegral(long integral) {
        if(integral != this.integral){
            this.integral = integral;
            setUpdateOption();
        }
    }

    public long getAllIntegral() {
        return allIntegral;
    }

    public void setAllIntegral(long allIntegral) {
        if(allIntegral != this.allIntegral){
            this.allIntegral = allIntegral;
            setUpdateOption();
        }
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        if(hp != this.hp){
            this.hp = hp;
            setUpdateOption();
        }
    }

    public long getHpTime() {
        return hpTime;
    }

    public void setHpTime(long hpTime) {
        if(hpTime != this.hpTime){
            this.hpTime = hpTime;
            setUpdateOption();
        }
    }

    public int getFinishFoodId() {
        return finishFoodId;
    }

    public void setFinishFoodId(int finishFoodId) {
        if(finishFoodId != this.finishFoodId){
            this.finishFoodId = finishFoodId;
            setUpdateOption();
        }
    }

    public String getFinishFoodData() {
        return finishFoodData;
    }

    public void setFinishFoodData(String finishFoodData) {
        if(!finishFoodData.equals(this.finishFoodData)){
            this.finishFoodData = finishFoodData;
            setUpdateOption();
        }
    }

    public int getFinishFoodCount() {
        return finishFoodCount;
    }

    public void setFinishFoodCount(int finishFoodCount) {
        if(finishFoodCount != this.finishFoodCount){
            this.finishFoodCount = finishFoodCount;
            setUpdateOption();
        }
    }

    public String getTableFoodData() {
        return tableFoodData;
    }

    public void setTableFoodData(String tableFoodData) {
        if(!tableFoodData.equals(this.tableFoodData)){
            this.tableFoodData = tableFoodData;
            setUpdateOption();
        }
    }

    public int getDishId() {
        return dishId;
    }

    public void setDishId(int dishId) {
        if(dishId != this.dishId){
            this.dishId = dishId;
            setUpdateOption();
        }
    }

    public int getProcess() {
        return process;
    }

    public void setProcess(int process) {
        if(process != this.process){
            this.process = process;
            setUpdateOption();
        }
    }

    public int getDishCount() {
        return dishCount;
    }

    public void setDishCount(int dishCount) {
        if(dishCount != this.dishCount){
            this.dishCount = dishCount;
            setUpdateOption();
        }
    }

    public boolean isWorship() {
        return isWorship;
    }

    public void setWorship(boolean worship) {
        if(worship != this.isWorship){
            isWorship = worship;
            setUpdateOption();
        }
    }

    public int getCampId() {
        return campId;
    }

    public void setCampId(int campId) {
        if(this.campId != campId) {
            this.campId = campId;
            setUpdateOption();
        }
    }

    public Map<Integer, ChefDuelFood> getTableFoodMap(){
        return JSON.parseObject(tableFoodData, new TypeReference<Map<Integer, ChefDuelFood>>() {});
    }

    public void setTableFoodMap(Map<Integer, ChefDuelFood> cookBoyFoodMap){
        setTableFoodData(JSON.toJSONString(cookBoyFoodMap));
    }

    public Map<Integer, ChefDuelFinishFood> getFinishFoodMap(){
        return JSON.parseObject(finishFoodData, new TypeReference<Map<Integer, ChefDuelFinishFood>>() {});
    }

    public void setFinishFoodMap(Map<Integer, ChefDuelFinishFood> cookBoyFinishFoodMap){
        setFinishFoodData(JSON.toJSONString(cookBoyFinishFoodMap));
    }

    public Map<Integer,ChefDuel2Dish> getFinishDishMap(){
        return JSON.parseObject(finishFoodData, new TypeReference<Map<Integer, ChefDuel2Dish>>() {});
    }

    public void setFinishDishMap(Map<Integer,ChefDuel2Dish> cookBoyDishMap){
        setFinishFoodData(JSON.toJSONString(cookBoyDishMap));
    }

    public long getRankTime() {
        return rankTime;
    }

    public void setRankTime(long rankTime) {
        if(this.rankTime != rankTime) {
            this.rankTime = rankTime;
            setUpdateOption();
        }
    }

    public int getCampRewardGet() {
        return campRewardGet;
    }

    public void setCampRewardGet(int campRewardGet) {
        if(this.campRewardGet != campRewardGet) {
            this.campRewardGet = campRewardGet;
            setUpdateOption();
        }
    }

    public int getPreRank() {
        return preRank;
    }

    public void setPreRank(int preRank) {
        if(this.preRank != preRank) {
            this.preRank = preRank;
            setUpdateOption();
        }
    }

    public int getSupportCampId() {
        return supportCampId;
    }

    public void setSupportCampId(int supportCampId) {
        if(this.supportCampId != supportCampId) {
            this.supportCampId = supportCampId;
            setUpdateOption();
        }
    }

    public int getBuffNum() {
        return buffNum;
    }

    public void setBuffNum(int buffNum) {
        if(this.buffNum != buffNum) {
            this.buffNum = buffNum;
            setUpdateOption();
        }
    }
}
